adapted scala input