fixed the order of select statement
fixed the doctest
fixed comments
the draft of connection between model and db