took @Daxter's advice and some other changes