first draft
added main code