set max recursion depth to 2048

closes gh-2
use macros for constants