somewhat functional, ton of bugs. needs re-write