still working on re-arranging code