fixed sessions. finished writing module functions