Rearrangged methods
added sample main