Added preference input and solved an older problem