Pull request

think i got it right this time. it works on my project, but you might want to review because