cleaned up assignment code