Added domain variable + few new functions