attribution fix

Added attribution to DevGeeks for most of this code is based off his.