Updated code and added documents