added model logic