Some extra scripts to be used later

Also cleaned up the code