Fixed visual bugs, cleaned up code