code through 9.15 added for login func