Your post is basically "Here's my code, fix it for me because I'm lazy".

If you want help then ask a specific question.

BTW creating an array to hold a single value is a waste of resources.