changed size, cleaned up code a bit