Just cleaned up some code

initialized some var's and cleaned up logic