Added more code for handling sections (still not working)