cleanup
cleanup
simplify checks for triangle