making a lot more progress, just need to add a few more functions