added margins, do not allow empty words as input