first draft of code

Still not working but I think its getting close.