moved main to pcm.cpp