changed magic numbers to constants, fixed implementation of clear button, fixed bug with add button