cleaned up + added comments