organise

starting to move functions etc