my custom version that works the way i want it to