Molecular dynamics simulation of structure formation of short chain molecules