modified the code to basic one