First dirty version. TODO: Add file decoding