Changed model and fixed constraints