added build.gradle, tidied code