decrease line length
remove ternary operator
change typehints from num to double
use setAsBox