Progress on Prob 2

Made a function, still needs testing