fix constant declaration
implemented most of the pattern stuff