incorporating srividya22's additions and changes