modified advanced password class for new SQL structure