Updated with some more changes, still not quite working