Fragments work

needs some cleaning up