Cleaned up code  and added more commenting for prying eyes