finished cleaning up code