slightly updated code for riya