-cleaned up code