Changed file structure; added some comments