fixed some of the issues I had with implementation