commiting this code for reference reasons