some writing, started on dynamic programming implementation