removed all unnecessary functions ready to debug