finished super rough probably incorrect version