finalized build, needs optimization