added contraint protection and nice syntax