Finished coding.. now need to debug..

Use this as the final copy