most of the functionality is there and working, just need to figure out a cleaner way of doing this