Cleaned up then code a little