style changes (fixed whitespaces and stuff), also changed assert statements to logger.errors