added boolean to flip input 180°