Edited the code structure