Feature/flash cast

looks like this whole file could be reverted back to master