cleaned up code round 1