made some modifications to suit me