added logic for exp)
some bugfixes