Basic implementation and comments added