This is my replica of work by revere.R